package com.baizhi.wd.view;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class FormView extends HttpServlet {
	public void service(HttpServletRequest request,HttpServletResponse response) throws IOException{
		try{
		//1.设置响应类型
		response.setContentType("text/html;charset=utf-8");
		
		//2.获取输出流
		PrintWriter out = response.getWriter();
		//3.使用输出流
		String str = (String)request.getAttribute("content");
		
		out.println("<html>");
		out.println("<title>简答题2</title>");
		out.println("<body>"+str+"</body>");
		out.println("</html>");
		}catch(Exception e){
			response.sendRedirect("/telbook_2/catchError.html");
			e.printStackTrace();
		}
	}
}
